package com.yy.controller.ForegroundController;

import com.yy.service.ForegroundService.impl.FileuploadServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * 文件上传接口
 */
@RestController
@RequestMapping(value = "/fileUpload")
public class FileuploadController {

    @Autowired
    private FileuploadServiceImpl fileuploadService;

    /**
     * 图片上传接口
     * @return String
     */
    @RequestMapping(value = "/imgUpload" ,method = RequestMethod.POST)
    public List<String> imgUpload(@RequestParam("file")MultipartFile[] file) throws Exception{
        return fileuploadService.imgUpload(file);
    }
}
